package com.example.mapper;

import com.example.entity.Artwork;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 操作artwork相关数据接口
 */
public interface ArtworkMapper {

    /**
     * 新增
     */
    int insert(Artwork artwork);

    /**
     * 删除
     */
    int deleteById(Integer id);

    /**
     * 修改
     */
    int updateById(Artwork artwork);

    /**
     * 根据ID查询
     */
    Artwork selectById(Integer id);

    /**
     * 查询所有
     */
    List<Artwork> selectAll(Artwork artwork);

    List<Artwork> selectByContestId(Integer contestId);
    
    List<Artwork> getArtworkList(Map<String, Object> params);

    int getTotalCount(Map<String, Object> params);


    Integer[] getAllScores(@Param("contestId") Integer contestId);

    Integer getScore(Integer id);

    void updateScoreById(Integer id, Integer score);

    void updatePrizeAndRank(Integer contestId);
}